package test00;


import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

/**
 * @Author lzp
 * @Date 2024-03-26
 */
public class test02 {
    public static void main(String[] args) throws Exception {

        Class<Integer> clazz = Integer.class;

        Field[] fields = clazz.getDeclaredFields();

        String strClassModeifeld = Modifier.toString(clazz.getModifiers());
        String className = clazz.getSimpleName();

        System.out.println(strClassModeifeld + " class " + className +"{");

        for (Field field : fields) {
            String strModifer = Modifier.toString(field.getModifiers());
            String typeName = field.getType().getName();
            String fieldname = field.getName();

            System.out.println("\t"+strModifer+ " " + typeName+ " " +fieldname);

        }

        System.out.println("}");

    }
}
